package com.lyl.feign;

import com.lyl.dto.UserDto;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

/**
 * @author lylbell
 * @date 2021-06-30 15:29
 */
//OAuth2FeignConfig:获取请求中的token，在各微服务之间传递，让访问具有权限
@FeignClient(name = "member-server",configuration = OAuth2FeignConfig.class,path = "/users")
public interface UserServiceFeign {

    /**
     * 用于admin-server 里面远程调用member-server
     * @param ids
     * @return
     */
    @GetMapping("/basic/users")
    Map<Long,UserDto> getBasicUsers(@RequestParam(value="ids",required = false) List<Long> ids,
                      @RequestParam(value="username",required = false)String username,
                      @RequestParam(value = "mobile",required = false)String mobile
    );
}
